//package demo;
//
//import java.util.Random;
//
//public class MinAndMax {
//    double min,max;
//
//    public static class GetMinAndMax {
//        static double min, man;
//        static MinAndMax getResult(double[]A){
//            min=A[0];man=A[0];
//            for(int x=1;x<10;x++){
//                getmin(A[x]);
//                getmax(A[x]);
//            }
//            MinAndMax G=new MinAndMax();
//            G.min=min;
//            G.max=man;
//            return G;
//        }
//        static void getmin(double i){ if(i<min)min=i; }
//        static void getmax(double x){ if(x>man)man=x; }
//    }
//
//    public static void main(String[] args) {
//        double[] A=new double[10];
//        for(int x=0;x<10;x++) {
//            A[x]=new Random().nextDouble()*10;
//            System.out.println(A[x]);
//        }
//        MinAndMax B=new MinAndMax();
//        B=GetMinAndMax.getResult(A);
//        System.out.println("最大值为"+B.max);
//        System.out.println("最小值为"+B.min);
//    }
//}
//


public class MinAndMax {
    public static void main(String[] args) {
        Goods iphone;
        iphone = new Goods(123423, "苹果17 ProMax", 9999, 12999, "旧金山");
        iphone.show();
        boolean earn = iphone.isEarn(iphone.getGtin(), iphone.getSellPrice());
        System.out.println("是否盈利：");
        System.out.println(earn);
        Clothing Armanijack = new Clothing(123456, "皮夹克", 1980, 3990, "意大利", 170.5, "阿玛尼");
        Armanijack.show();
    }
}
class Goods{
    static private String Type;
    private long id;
    private String name;
    private double purchasePrice;
    private double sellPrice;
    private String production;
    public Goods(long id, String name, double purchasePrice, double sellPrice, String production){
        this.id=id;
        this.name=name;
        this.purchasePrice =purchasePrice;
        this.sellPrice = sellPrice;
        this.production=production;
    }
    public Goods(){
        this(0,"*****",0.0,0.0,"*****");
    }
    public long getId() {
        return id;
    }
    public void setId(long id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public double getGtin() {
        return purchasePrice;
    }
    public void setGtin(double gtin) {
        this.purchasePrice = gtin;
    }
    public double getSellPrice() {
        return sellPrice;
    }
    public void setSellPrice(double sellPrice) {
        this.sellPrice = sellPrice;
    }
    public void show(){
        System.out.println("编号"+id);
        System.out.println("名称"+name);
        System.out.println("进价"+ purchasePrice);
        System.out.println("售价"+ sellPrice);
        System.out.println("产地"+production);
    }

    public boolean isEarn(double gtin,double ptout){
        return ptout>gtin;
    }
}
class Clothing extends Goods{
    private double size;
    private String band;

    public Clothing(long id, String name, double purchasePrice, double sellPrice, String production, double size, String band){
        super(id,name,purchasePrice,sellPrice,production);
        this.size=size;
        this.band = band;
    }
    public void show(){
        super.show();
        System.out.println("尺码为："+size);
        System.out.println("品牌是："+band);
    }
}
